package com.cskaoyan.service;

import com.cskaoyan.dao.UserDao;
import com.cskaoyan.dao.UserDaoImpl;

/**
 * @author stone
 * @date 2022/12/19 09:11
 */
public class UserServiceImpl implements UserService{

    UserDao userDao;// = new UserDaoImpl(); userDao的值来源于应用程序
    // 学了Spring框架，这个值的来源应该来源于容器

    public UserDao getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public void sayHello(String name) {
        System.out.println("你好，" + name);
        userDao.sayHi();
    }

    @Override
    public void sayGoodbye(String name) {
        System.out.println("再见，" + name);
    }
}
